Skip to content

Conversation

@brianredbeard
Copy link

Summary

  • Add set -euo pipefail for strict error handling
  • Quote all variable expansions to prevent word splitting
  • Convert string variables to arrays for shellcheck compliance
  • Use mktemp for secure temporary directories

Changes

pattern.sh

  • Add set -euo pipefail at script start
  • Quote "$1", "$@", and other variable expansions
  • Convert PODMAN_ARGS, PKI_HOST_MOUNT_ARGS, EXTRA_ARGS to bash arrays
  • Use "${ARRAY[@]}" syntax for proper array expansion

run_tests.sh

  • Add set -euo pipefail at script start
  • Quote "$KUBECONFIG" and other variables
  • Use mktemp -d instead of hardcoded /tmp paths
  • Validate WORKSPACE with ${WORKSPACE:-} syntax

Test Plan

  • Run shellcheck pattern.sh - should pass with no warnings
  • Run shellcheck tests/interop/run_tests.sh - should pass
  • Test pattern.sh with various arguments including spaces

Fixes #522
Fixes #523
Fixes #524
Fixes #525
Fixes #526
Fixes #527
Fixes #528
Fixes #529
Fixes #530

- Add set -euo pipefail for strict error handling
- Quote $1 in command -v to prevent word splitting
- Quote $@ to preserve argument boundaries
- Fix regex pattern: use ${HOME} with proper quoting
- Quote $REMOTE_PODMAN in arithmetic comparison
- Add fallback for REMOTE_PODMAN if command fails
- Use ${VAR:-} syntax for unset variable checks with set -u
- Add error handling for podman --version command
- Convert PODMAN_ARGS, PKI_HOST_MOUNT_ARGS, EXTRA_ARGS to arrays for shellcheck compliance
- Add set -euo pipefail for strict error handling
- Quote all variable references ($KUBECONFIG, $KUBECONFIG_EDGE, $WORKSPACE)
- Use ${VAR:-} syntax for unset variable checks with set -u
- Use mktemp -d instead of /tmp for secure temporary directory
- Tests will now fail fast on any error instead of continuing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment